package cn.stylefeng.guns.modular.wx.mp.builder;

import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;

/**
 * 红包消息
 * 
 * @author Binary Wang(https://github.com/binarywang)
 */
public class ArticleBuilder{
	
	public WxMpXmlOutMessage build(String title,String content,String imgUrl,String url,WxMpXmlMessage wxMessage, WxMpService service) {
		// TODO Auto-generated method stub
		WxMpXmlOutNewsMessage.Item article = new WxMpXmlOutNewsMessage.Item();
		  
		 
	  article.setPicUrl(imgUrl);
	  article.setTitle(title);
	  article.setDescription(content);
	  article.setUrl(url);
          
      WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
    	.toUser(wxMessage.getFromUser())
    	.fromUser(wxMessage.getToUser())
    	.addArticle(article)
    	.build();
    	

        return m;
	}

}
